def test(a, b):
    print(a + b)
    return a + b


result = test(1, 2)
print(result)


# 支持返回多个值
def test1(a, b):
    return a + b, 10, 20, 30, 40


result = test1(1, 2)
print(result)

i = 100  # 全局变量


def test2():
    i = 1000  # 局部变量
    print(i)


test2()

k = 20  # 全局变量
k1 = 100


def test3():
    global k, k1
    k = 21  # 修改全局变量,必须要声明global
    k = 101


test3()
print(k)
